package fa7.socialcode.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import fa7.socialcode.dao.NoticiaDao;
import fa7.socialcode.model.Noticia;
import fa7.socialcode.service.NoticiaManager;

@Service(value = "noticiaManager")
public class NoticiaManagerImpl implements NoticiaManager {

	@Autowired
	NoticiaDao noticiaDao;

	public void setNoticiaDao(NoticiaDao dao) {
		this.noticiaDao = dao;
	}

	public List findNoticias() {
		return noticiaDao.findNoticias();
	}

	public Noticia findNoticia(String noticiaId) {
		return noticiaDao.findNoticia(Long.valueOf(noticiaId));
	}

	public void saveNoticia(Noticia noticia) {
		noticiaDao.saveNoticia(noticia);
	}

	public void removeNoticia(String noticiaId) {
		noticiaDao.removeNoticia(Long.valueOf(noticiaId));
	}
}